﻿<template>
    <el-dialog title="上传发货照片" v-model="visible" :width="800" destroy-on-close @closed="$emit('closed')">
        <el-form :model="entityObj" :rules="rules" :disabled="mode == 'Show'" ref="dialogForm" label-width="100px">
            <el-row>
                <el-col :span="24">
                    <el-form-item label-width="120px" label="发货照片">
                        <sc-upload-multiple 
                            v-model="entityObj.sendFiles"
                            :objName="'Supply/SendFiles'" 
                            :uploadType="'OSS'" 
                            :bucketName="'jtmc'" 
                            :limit="5"
                        />
                        
                    </el-form-item>
                </el-col>
               
            </el-row>
           
            <el-row>
                <el-col :span="24">
                </el-col>
            </el-row>
        </el-form>
        <template #footer>
            <el-button @click="visible = false">取 消</el-button>
            <el-button  type="primary"  :loading="isSaveing"  @click="submit()">确 定</el-button>
        </template>
    </el-dialog>
</template>
<script>
import tool from "@/utils/tool";
export default {
    emits: ["success", "closed"],
    data() {
        return {
            mode: "SendFiles",
            visible: false,
            isSaveing:false,
            titleMap: {
               
            },
            entityObj: {
            },
           
        };
    },
    computed: {
    },
    methods: {
        //显示=
        open(mode = "") {
            console.log("上传发货照片");
            this.mode = mode;
            this.visible = true;
            return this;
        },
        //表单注入数据
        async setData(data) {
            this.$nextTick(() => {
                var sendFiles=data.sendFiles?data.sendFiles.join(","):"";
                this.entityObj.sendFiles=sendFiles;
            });
           
        },
        //提交
        submit() {
            console.log("上传照片确定",this.entityObj)
            this.$emit("setSendFiles",this.entityObj.sendFiles);
            this.visible = false;
        }
    },
    async mounted() {
    },
};
</script>

<style scoped>
.el-form-item {
    margin-bottom: 8px !important;
}
</style>
